Categorical Variables in R
- Numeric variables by default continuous
- Ex: BMI = 29.5, 39.3, 19.1211, …
- String variables by default categorical
- Ex: M, F, male, female, hypotensive, hypertensive, …
- What if you wanted a numeric variable to be categorical?
- Ex: chromosome number = 1, 2, … 23
- Ex: sex = 0, 1